]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
panel: Delegate container destruction to PanelMenu.ButtonBox
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Wed, 29 Aug 2018 01:37:27 +0000 (22:37 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Tue, 9 Oct 2018 01:43:13 +0000 (22:43 -0300)
Instead of taking care of the PanelMenu.ButtonBox.container
destruction by itself, delegate that to the very object that
created it in the first place: PanelMenu.ButtonBox itself.

js/ui/panel.js
js/ui/panelMenu.js

index e61557ab90fe40c654ecfe5477b167158c1611c3..49759af4c35ccdf14182bd35fc25d9a199b92856 100644 (file)
@@ -1158,7 +1158,6 @@ var Panel = new Lang.Class({
         let destroyId = indicator.connect('destroy', emitter => {
             delete this.statusArea[role];
             emitter.disconnect(destroyId);
-            container.destroy();
         });
         indicator.connect('menu-set', this._onMenuSet.bind(this));
         this._onMenuSet(indicator);
index 6f496db976ea499b20100291dd63af9dcaac0f24..401419decde5511c34e640ecb1222ecd6bea2e22 100644 (file)
@@ -30,6 +30,8 @@ var ButtonBox = new Lang.Class({
                                       child: this.actor });
 
         this.connect('style-changed', this._onStyleChanged.bind(this));
+        this.connect('destroy', this._onDestroy.bind(this));
+
         this._minHPadding = this._natHPadding = 0.0;
     },
 
@@ -90,6 +92,11 @@ var ButtonBox = new Lang.Class({
 
         child.allocate(childBox, flags);
     },
+
+    _onDestroy() {
+        this.container.child = null;
+        this.container.destroy();
+    },
 });
 
 var Button = new Lang.Class({
@@ -106,7 +113,6 @@ var Button = new Lang.Class({
 
         this.connect('event', this._onEvent.bind(this));
         this.connect('notify::visible', this._onVisibilityChanged.bind(this));
-        this.connect('destroy', this._onDestroy.bind(this));
 
         if (dontCreateMenu)
             this.menu = new PopupMenu.PopupDummyMenu(this.actor);
@@ -190,6 +196,8 @@ var Button = new Lang.Class({
     },
 
     _onDestroy() {
+        this.parent();
+
         if (this.menu)
             this.menu.destroy();
     }